<?php
get_header();
include TEMPLATEPATH . '/inc/featured.php';
?>

<?php get_sidebar(); ?>
<div id="main-content">
    <div class="post">
        <ul class="links">
            <?php
            $home_cat = get_option('origin-home-cat');
            $sing_cat = explode(',', $home_cat);
            is_numeric($sing_cat[0]) ? $cat1= trim($sing_cat[0]) : $cat1 = 7;
            is_numeric($sing_cat[1]) ? $cat2= trim($sing_cat[1]) : $cat2 = 4;
            is_numeric($sing_cat[2]) ? $cat3= trim($sing_cat[2]) : $cat3 = 6;
            ?>
            <?php
            $video_links = new WP_Query('showposts=3&cat='.$cat1.'&offset=1');
            while ($video_links->have_posts()):$video_links->the_post();
                ?>
            <li><a href="<?php the_permalink(); ?>" data-tooltip="<?php the_content_rss('',true,'',30); ?>"><?php the_title(); ?></a></li>
            <?php endwhile;
            wp_reset_postdata(); ?>
        </ul>
        <?php
        $videos = new WP_Query('showposts=1&cat='.$cat1);
        while ($videos->have_posts()): $videos->the_post();
            ?>
            <h2><a href="<?php the_permalink(); ?>"><?php the_category(','); ?></a></h2>

            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> 
            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <?php the_excerpt(); ?>
            <p class="meta-data">By: <strong><?php the_author(); ?></strong> | On: <?php the_time('F j,Y') ?></p>
            <?php comments_popup_link('0', '1', '%', 'comment-link'); ?>

            <?php
        endwhile;
        wp_reset_postdata();
        ?>
    </div><!-- end post-->

    <div class="post">
        <ul class="links">
            <?php
            $phpTuts_links = new WP_Query('showposts=3&cat='.$cat2.'&offset=1');
            while ($phpTuts_links->have_posts()):$phpTuts_links->the_post();
                ?>
                <li><a href="<?php the_permalink(); ?>" data-tooltip="<?php the_content_rss('',true,'',30); ?>"><?php the_title(); ?></a></li>
            <?php endwhile;
            wp_reset_postdata(); ?>
        </ul>
        <?php
        $phpTuts = new WP_Query('showposts=1&cat='.$cat2);
        while ($phpTuts->have_posts()): $phpTuts->the_post();
            ?>
            <h2><a href="<?php the_permalink(); ?>"><?php the_category(','); ?></a></h2>

            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> 
            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <?php the_excerpt(); ?>
            <p class="meta-data">By: <strong><?php the_author(); ?></strong> | On: <?php the_time('F j,Y') ?></p>
            <?php comments_popup_link('0', '1', '%', 'comment-link'); ?>

            <?php
        endwhile;
        wp_reset_postdata();
        ?>
    </div><!-- end post-->

    <div class="post">
        <ul class="links">
            <?php
            $jQueryTuts_links = new WP_Query('showposts=3&cat='.$cat3.'&offset=1');
            while ($jQueryTuts_links->have_posts()):$jQueryTuts_links->the_post();
                ?>
                <li><a href="<?php the_permalink(); ?>" data-tooltip="<?php the_content_rss('',true,'',30); ?>"><?php the_title(); ?></a></li>
            <?php endwhile;
            wp_reset_postdata(); ?>
        </ul>
        <?php
        $jQueryTuts = new WP_Query('showposts=1&cat='.$cat3);
        while ($jQueryTuts->have_posts()): $jQueryTuts->the_post();
            ?>
            <h2><a href="<?php the_permalink(); ?>"><?php the_category(','); ?></a></h2>

            <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?></a> 
            <h3><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h3>
            <?php the_excerpt(); ?>
            <p class="meta-data">By: <strong><?php the_author(); ?></strong> | On: <?php the_time('F j,Y') ?></p>
            <?php comments_popup_link('0', '1', '%', 'comment-link'); ?>

            <?php
        endwhile;
        wp_reset_postdata();
        ?>   
    </div><!-- end post-->
</div><!-- main-content -->
<?php get_sidebar('second'); ?>
<?php get_footer(); ?>